package com.woniuxy.auth.service.impl;

import com.woniuxy.auth.mapper.AuthDao;
import com.woniuxy.auth.service.AuthService;
import com.woniuxy.commons.entity.User;
import com.woniuxy.commons.entity.wyh.GradeDean;
import com.woniuxy.commons.entity.wyh.TeamMaster;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author： 雷鹏
 * Date: 2020/7/21 19:59
 */
@Service
public class AuthServiceImpl implements AuthService {
    @Autowired
    private AuthDao authDao;

    @Override
    public User getUser(User user) {
        return authDao.getUser(user);
    }

    @Override
    public boolean isMaster(int rid) {
        List<TeamMaster> master = authDao.isMaster(rid);
        if (master.size() > 0) {
            return true;
        }
        return false;
    }

    @Override
    public boolean isGrade(int rid) {
        List<GradeDean> grade = authDao.isGrade(rid);
        if (grade.size() > 0) {
            return true;
        }
        return false;
    }
}
